package stbm.objects;

import java.util.LinkedList;

/**
 * Represents a single planet in the universe
 * 
 * @author Nirav
 * @author Nisha
 * 
 */

public class Planet {

	public String name;

	public TechLevel techLevel;

	public Resource[] resources;

	public Store store;

	public TradeGood tradeGood;

	public double salesTax;

	public GasStation gasStation;

	public int distanceFromCenter;

	/**
	 * Creates a new Planet with the given name and location in the Universe
	 * 
	 * @param name
	 *            the name of the planet
	 * @param location
	 *            a Coordinate representing the location of the Planet in the
	 *            Universe
	 * @param techLevelType
	 *            a string representing the type of TechLevel assigned to this
	 *            Planet
	 * @param resource1
	 *            the first of the two resources this Planet has
	 * @param resource2
	 *            the second of the two resources this Planet has
	 */
	public Planet(String name, String techLevelType, Resource resource1,
			Resource resource2, TradeGood tg1, TradeGood tg2,
			int distanceFromCenter) {
		this.name = name;
		this.techLevel = new TechLevel(techLevelType);
		this.resources = new Resource[2];
		resources[0] = resource1;
		resources[1] = resource2;
		LinkedList<TradeGood> tg = new LinkedList<TradeGood>();
		tg.add(tg1);
		tg.add(tg2);
		this.store = new Store(tg, this.name);
		setTax();
		this.gasStation = new GasStation();
		this.distanceFromCenter = distanceFromCenter;
	}

	public void setTax() {
		/*
		 * switch (name) { case "Rojo": salesTax = 0.18; break; case "Azul":
		 * salesTax = 0.17; break; case "Amarillo": salesTax = 0.15; break; case
		 * "Verde": salesTax = 0.1; break; case "Naranja": salesTax = 0.05;
		 * break; }
		 */
	}

	public String getName() {
		return name;
	}

	public TechLevel getTechLevel() {
		return techLevel;
	}

	public Resource[] getResource() {
		return resources;
	}

	public TradeGood getTradeGood() {
		return tradeGood;
	}

	public String toString() {
		return "Planet Name: " + name + "\n" + "Tech Level: " + getTechLevel()
				+ "\n" + "Resources: " + resources[0] + ", " + resources[1]
				+ "\n" + "Trade Goods: ";
	}
}
